home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / 3dlib30b.zip / PROJECT3.H < prev    next >
C/C++ Source or Header  |  1994-03-10  |  4KB  |  70 lines

  1. /******************************************************************************
  2. *                                 project3.h                                  *
  3. *      this unit has 2 instances : the first one is used with the windows      *
  4. *               graphic user interface, and the other does not,                *
  5. *                                                                              *
  6. *             +-------------------------------------------------+              *
  7. *             |  this unit is NOT interfaced to the window GUI, |              *
  8. *             |   for use on a bare screen ONLY - for runTime!  |              *
  9. *             |                ****                             |              *
  10. *             +-------------------------------------------------+              *
  11. *                                                                              *
  12. *this unit handles the 3d -> 2d projections, we use 2 different methods        *
  13. *       of projections :                                                       *
  14. *                                                                              *
  15. *               A : axonometric projections, no perspective due to             *
  16. *                       distance is performed, the general way                 *
  17. *                       we can look at the coordinate system is as             *
  18. *                       follows :                                              *
  19. *                                                                              *
  20. *                               |  z axis                                      *
  21. *                               |                                              *
  22. *                              / \                                             *
  23. *                    x axis   /   \  y axis                                    *
  24. *                                                                              *
  25. *               B : perspective projections : the normal eye perspective       *
  26. *                       projection is performed, we can look at the 3d         *
  27. *                       universe we are refering to as a cube of               *
  28. *                       1000 x 1000 x 1000 integer locations, with             *
  29. *                       the x axis, and y axis parallel to the screen          *
  30. *                       x, y axis respectivly, and the z axis going into       *
  31. *                       the screen.                                            *
  32. *                                                                              *
  33. *                       we will look at the coordinate system as follows :     *
  34. *                                                                              *
  35. *                       │ Y axis                                               *
  36. *                       │                                                      *
  37. *                Z axis x------ X axis                                         *
  38. *                                                                              *
  39. ******************************************************************************/
  40.  
  41. #ifndef _project3_h
  42. #define _project3_h
  43.  
  44. #if !defined(_hdr3d_h)
  45. #include "hdr3d.h"
  46. #endif
  47.  
  48. #ifndef _windows
  49. #include <graphics.h>
  50.  
  51. extern int GraphDriver;
  52. extern int GraphMode;
  53. extern unsigned int maxX, maxY;
  54. extern unsigned int maxColor;
  55.  
  56. #endif
  57. extern int perspective; // true = perspective, else = axonometric
  58.  
  59. extern "C" void calcPoint(point3d p3d, screenPoints& psc);
  60. extern "C" void setPerspective();
  61. extern "C" void resetPerspective();
  62. extern "C" void togglePerspective();
  63.  
  64. #ifndef _windows
  65. extern "C" void startGraph(); // initialize the graphic engine
  66. extern "C" void endGraph(); // end the graphic engine
  67. #endif
  68.  
  69. #endif
  70.